package study.week05.gateway;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import study.week05.gateway.filter.CustomHttpFilter;
import study.week05.gateway.filter.CustomHttpFilter1;
import study.week05.gateway.filter.CustomRandomRefuseHttpFilter;
import study.week05.gateway.netty.NettyHttpServer;
import study.week05.gateway.router.CustomRouter;
import study.week05.gateway.router.RandomCustomRouter;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import java.util.Arrays;
import java.util.List;
//
@EnableAspectJAutoProxy
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class GatewayDemoApplication {
    public static void main(String[] args) throws InterruptedException {
        //配置类是study.week05.gateway.config.GatewayConfig
        ConfigurableApplicationContext ctx = new SpringApplicationBuilder(GatewayDemoApplication.class).web(WebApplicationType.NONE).run(args);
        NettyHttpServer gatewayServer = ctx.getBean(NettyHttpServer.class);
        gatewayServer.start();
    }

}
